home *** CD-ROM | disk | FTP | other *** search
- Path: in1.uu.net!interaccess!usenet
- From: brianmcg@interaccess.com (Brian V. McGroarty)
- Newsgroups: comp.lang.c
- Subject: Re: Pointer swapping
- Date: 21 Mar 1996 14:18:27 GMT
- Organization: Internet Squire
- Message-ID: <4irofj$2g2@nntp.interaccess.com>
- References: <4imjit$oil@pearl.whoi.edu>
- Reply-To: brianmcg@interaccess.com
- NNTP-Posting-Host: d222.nhe.interaccess.com
- X-Newsreader: Internet Squire 1.20
-
- mhill wrote:
- >I have two int huge arrays with a pointer to each which I use to access and
- >assign values. After assigning values to one of the arrays I want to swap
- >pointers between the two arrays.
-
- >main()
- > {
- > int ct = 0;
- > do
- > {
- > int huge prtA = A;
- > int huge ptrB = B;
- [...]
- > }while
-
- >Information seems to be loss when I do this . Shouldn't this work?
-
- In the above, prtA and prtB are initialized every time you enter their
- scope. If you move their declarations outside of the do/while loop you
- shouldn't have any problem.
-
-
-
-
- ---
- Brian Valters McGroarty -- brianmcg@bix.com
- phone/fax (847) 439-7714
-
-
-
-
-
-
-
-
-